Got the first function working with a class