add two helper functions.