made the addData func slightly more modular