my first solution
add an elegent solution