adding second solution I like 

adding update to second solution