added intrawell prediction function