Added a test loop to test.py