Removed print statments and redundant code.