Updated for runtime exception and tests