Working solution, kind of slow