added prediction function