added solution simplification