debugged eveything except data output