overhauled main function to fit main design goal; removed unneeded functions