Trying to hook some of this code in