Cosmic ray flux at the earth in a variable heliosphere