Improved Testing Code