use grow function to speed up solve