reimplementation of underscorejs