Added modular functions that can be imported from main program