Minor changes to code. removed commented out unused code.