Add speed up algorithm