Cleaned code a lot and commented more carefully.
Made continuation value calculation to use debug utility.