Removed non-useful DebugLog()
Removed inefficiency by avoid double checking