made lots of little changes and bug fixes.