Fixed guessPages and cleaned up output