Removed redundant statements and some debugging statements