Creates class and required function