Added main functionality