add function structure (untested)