made cosmetic changes and added first time gap calculation