Replace the magic numbers with constants.
Remove unused variables