minor fixes
best performance so far