Cleaning up debug code
algo details updated