More work on main calling function