Added solve4, modified main.