read http://www.theerlangelist.com/2012/12/yet-another-introduction-to-erlang.html