First solution to 1-4