implement basic filtering and pretty printing