Based on https://github.com/C0deh4cker/SuperCalc