Actually use algorithm for 5