Debugging & code improvement