added several functions for manipulating activity data.