Finished potential implementation (not tested)