Removed print statements to make it faster.