resolves #2, javascript finished