Implementation of skip algorithm, compiles, not tested