Removed unused variable 'n'.
Removed unnecessary pre-declarations of local variables.