Added lots of new functionality