loads of documentation and optimization and stuff