Behavioral economics has shown that in many situations, people's behavior differs from what is predicted by simple traditional utility-maximization economic models. It is therefore desirable to be able to accurately describe people's actual behavior. In some cases, the difference from the traditional models is caused by bounded rationality -- our limited ability to process information and to come up with a truly optimal solutions. In such cases, predicting people's behavior is difficult. In other cases, however, people actually optimize -- but the actual expression for utility is more complicated than in the traditional models. In such case, it is, in principle, possible to predict people's behavior. In this paper, we show that two phenomena -- reciprocity and temptation -- can be explained by optimizing a complex utility expression. We hope that this explanation will eventually lead to accurate prediction of these phenomena.