Removed commented code and added necessary comments.