Eliminated some redundancy, cleaned up code.
Removed extra blank lines