puzzle solved by Thiago de casas