Finishing basic plotting function from earlier