erlang grab bag of useful functions