more changes to better support configurable resolutions.  minor cleanup.