completed second day of erlang