completed sequence.py and tested for correctness