Initial version of problem 1 & 2