fixes, speed improvements