erlang solution for reading books