restructed code and added in subset2