added an input function and switched from oops to functional for the time being