Made script into a class