Reviewed the code, placed comments where necessary