generic increment method