solution 2 in js
clean up solution
solution in lisp