Removed loop simplify inclusion in code. Must be run beforehand