cleaned up code and dehug logs