debugging and cleaning