Removed unused code
Removes unused variables, fixes pointer warning