created functions for each table