Might've made algorithm faster