Modified Code to remove Dictionary.