Update code

Just a small change to make the code less painfully terrible and a bit more efficient for future users.