updated 3 sum for a better solution