Initial checking, stolen from command module example code