added explanation for data manipulation, fixed docstrings and changed vector of entities to map