switched from class to function system