added a pseudo code for tokenizing the user-agent string
added inline documentation; added basic sanitization to two user inputs