Improved regex and started on line processing