Merged with Refactoring branch
Some more functionality implemented.