My first attempt at rewriting many of the functions in underscorejs