latest implementation of add_data

removed all debugging lines