added comments, and some nice stylin