improve zoom code