Combined the second and third script