main functions work