edits, fixes, optimizations