more helpful comments
attempt at extracting code pre processing. breaks tests