changed paths
removed debugging
added factory sort