function rearangement debug prints