caveats: - not efficient nor heavily tested - API subject to change and currently incompatible with map