add main functionality