Updated functions.erl file