Finished converting pseudocode for parseItem