class solution and my solution added