Logic implementation for traffic Control Application