solved second exercise