Fixed code formating, added comments.