Fixed bugs. Removed unneeded method.