random code and better if else