Add virtual destructor in LineHandler class. Change signature for main.