made plot loop more readable