My first real erlang fix