made modifications according to comments; need to fix some more