Cleaned up the code.

Made the calculate methods private and invoked them in the constructor.