add docs and a test(broken right now..)