fixing and learning

how to exit from elif?
Revert "fixing and learning"

This reverts commit 2d21f5ba9076e6309e55472e169388aac7619db0.
added the exiting loop statement

should work now