added comments and some layout changes