minor edits for readability
last edits on js for style