Please move these declarations to the top of the function (idk why this is not checked by jshint, because it should be)