Cleaned up the Code