Nit: it's not recommended to use `var` a lot in the code. Specifying the variable type will make it much clearer.