converted to class. provided example script