make add and subtract javascript functionality work