It works when the mechanics are correct
cleaned up some public variables and added more debug prints