Optimized solve4, added first submission.