moving plot functions into module