more corrections and cleanup