Completed ex3_1.erl :)