final version from class