Condense js, add comments