Assignment 5.1 redone without using lodash

No lodash involved.