Debugged and discovered issue with IF statements, used to return colnum=5 for all cases. Checks ok now with PDF answers