Added prepare where needed, multiple valid functions (where needed), and duplicate test cases (where needed)