second commit, cleaned up js code