Erasing unused variable.
Added main method and a bit of restructuring.