due to needing to call recur, there hardly seemed any point in keeping this as a function any longer;
silver lining: I got to reduce the overall indentation level;