S test finished

code working. may need testing?