removed commented code; minor improvements