prediction logic boilerplate