a lot more code reduction thanks to pandas, see #64
updated output