minor code changes plus some plots