implemented use of get_marked_gaps function