Cleaned up code and added unlim. subfolder support