Finished repeat, if-then-else