tried to implement in class, failed