some fixes for speed
trying to speed things up