typos
moved most hardcoded and duplicated code into utils.py
try to capture Rout file in result whenever possible