forgot to explain how script works