Added GenTests function