solutions for 2-4
adding solution for 6