Switching to faster version
Cleaning up code