added main functions