quick reimplementation of underscore