implemented test mode