rename functions; add docs