Implementing a Queue in Python