updated createXts function to use a start and end value