plot1: code refactored.