reworked version to bypass Windows \r and 'cache' files