updated tests
speed optimizations