made scripts more flexible