make main requireable
add profiler
remove assertion
optimize decimation