new mainfunction, problems with alive counter