port stuff over from command line