update documentation + clean up javascript