Move predict to subfunctions.