plot curves debugged