added plotting function for Task3 & TODO notation