Added main functions for unittest