Completes logic, but no testing yet.