edited various functions in challenge.js