a lot of complex fixes