Sample code written while learning erlang