Fixed boneheaded way of computing predicessor cost