beginning js code review