additions, fixes and cleanup