Made changes to speed up