added three options to the function