Added functionality for 'ans' keyword, changed output to string