Why to add 30? instead substract it.
Borrowed 240 each from friend1 and friend2 (after returning 10 each).
total borrowed: 480
Brought the stuff for 450.
Balance = 480-450 = 30.