implemented improvements and bugfixes