subtracted MainFunctionality.js into two files