move addition to its own function