fixed tests, added docs, renamed helper method