Code Cleaned and Commented