Efficiency change

Changed vector to treeset, faster access