Script to run in real time