rearranged some stuff and fixed a prereq bug and added docstrings