Updated LineScanner class. Updated algorithm to also look at leading and trailing bars. Added documentation.