Minor formatting changes and added some new functionality