Updated infix_to_prefix() to allow more complicated input