Fast alghoritm fix loop