added prediction function that works