Remove unnecessary #include.
Add more tests for 'if'.
Define a macro instead using magic number
Fix off-by-one error
Code cleanup.