solve done except for annoying nil at the end