added comments and some js updates