node impl.
solution to problem 15