Trying to implement Certificate Logic