some other printer refactorings, implement density vector