Added offset parameter and save feature