Utility Functions by Youyi & Krisz