Writing an object-oriented script