https://github.com/MrMEEE/bumblebee/...e0acce6#diff-1