changed the getelementbyids to getelementsbyclass with the array for each one