solution 3.js