Updated script to hopefully improve it.