ruby code that i have learnt