Define two functions
Changed lag of calc