Removed magic number from loop termination.