trying to fix some speed issues