Changed the CSScanner to be recursive. Needs to have more comprehensive test cases.