Basic Algorithm Implementation with ES6.