Change calculate to take an argument rather than prompt user for input