added a lot of new functionality