Added main functionality.