add isNumber, isDefined, update implementation of each and map