Optimization (blazingly fast!) + bugfixes