a script with the full solution