few error checks added, basic plotting added