Replaced return -1 with return None