changed output display and added a debug method