adding test code for non-interactive testing