solve first two problem