fix/Major bug in prediction code