changed some js at the advice of code climate