heavy improvements and bugfixes
heavy improvements and bugfixes