added code to find the bug that was hindering progress