Update sdtest.py

updated with latest changes - looping, functionality, environments