found the reason it crashes at 635. the cost becomes so large it corrupts the float that holds the cost :P