Cleaned Code

Cleaned and commented.