part1:basic function
part 2:plot