Added functionality

Extra info about this
Changed prototype
Made the calculation constant time
Made more user friendly
Merge branch 'optimize'