added some functions for datahandling