iteration counting working and histogram made