added comments and fixed alignment