added 2nd solution