Added print statement and fixed priority