prettied the code and added comments for the next guy