Integration of GPS and SD card algorithm