added parameter to optionally skip gap filling