code in debug mode, ready for review