Script updated, tested offline