version 0.3.1, minor fixes, optimizations