Added test for list circuits example script

Made better use of functions