Rewrote the script as a class (in OO)