grabbed functions from twentyfourteen