Translation of Hive Solver into erlang