possibly the fastest i can make greedy
not sure why these are changed but i should probably commit it