fixes debugging exercise to pass Mocha tests