adding two programs producing strange output/errors