added prediction function with scaling