Changed leap to use single if-else