more concise solution