fixed name of function
simplified code; fixed function name
added JSDoc link