a bit of refactor and better plotting added