Renamed str to string, added initial input and output types