made a little more efficient