iron out some kinks in main scripts