add structure and basic funtions