4th edit  public code for use in our testcase