problem 1 & 2 -> ruby