update from dev repo, speed optimizations