removed couts; fixed error while adding elements