added data gap handling in model - WARNING: not tested yet