made more efficent