converted to new prediction function