#3 fixed: made script scalable.