changed line parsing system to use regex