Cleaned up code. Removed redundant code