changed SM range, splitted plotting section