added main functionality