massive size optimization
some bugfixes