created common keystone connect function.  Added cmd return codes.  Added more comments