better plotting and more functions