Commented some code for my readability and some cleanup