removed external variables