generalize norm script to work on other variables