modifying rmdb.py for csv output