The code gives you back some of your invested money before it subtracts the rent, that means it is almost impossible to lose.