solution with tex