cleaning up rent function

adding the switch stmt