updating with latest changes, lots of small stuff