Fix timeout. Work on rewriting