Added better comments

Commented code and each function