Added checks for NULL values Added comments and quesitons as // TODO
Added DEBUG_LEVEL if DEBUG_LEVEL > 3, the execution is step by step.