Updated main source file.
Created new test files to automate the testing process.