Fixed an issue with mathematical operations and added a lot more documentation.