added 4 main functions