modified to do three additions