minor changes
cached some vars
more updates