Removed warnings

Removed an unused function and fixed integer sign type into for loop