first and second problem completed