first attempt at refining if statement in order for speed