I wish I knew there was a built-in function to do this sooner