Updated code to require parameters and allow modularity.