Change dir struct and add erlang solution.