Ported to Py3, added some extra features and fixed the "empty row" bug