Added my version of the code, with infinite loop