first crack at an erlang module for stathat