Declare stringA etc outside of the ‘if’ block. Also fixed bug which
caused 1,3,4,5 to display as 1:3:5.