fixes to funny code