Started work on plot function