flesh out tests and add more helper functions