Fixed code
Added alternative solution