lots of changes...lots of debugging