clean up; bug fixes