added more test mode functionality

also fixed some bugs