added -main functions