added the main things for solution 2