added austin's code for test mode