Elements of Queueing Theory with Applications