scriptmakir: combined two ifs to lessen the confusion