Cleaning things up, adding comments, added compiler warnings (Wall)