Updated version.
Cleaning up the code.