Added some new features plus some bugfixes