checkSN function has better handling of elements.