tested main functions