Proper skipping algorithm, some style fixes