changed from scrip to obj oriented style