Updated algorithm and added more sample lines