forgot to add this script. This script now contains all logic.