Minor optimization

Changed the order of some things, should be some % faster now.