Eliminated trailing spaces and cleaned up code.