edited  public code for use in our testcase