final version for modularity