updates, fixes, optimization