Added visualization to testing code for S1