removed unused variable of sname and cname