improved with multiple assignment