A lot bugfixes and some extentions, first prototype working