several changes and cleaning up