Figured out the problem, fixed ordering and removed debug stuff