browser compatibility and variable tidying