Final debugging done. Will upload to longitudinal branch.