main methods for all 4 types of functions