debugging and writing