bugfix: adding up variables correctly