Added some of Chris' logic