debugging sams and mine code