Revert "Revert ser.py"

This reverts commit 46ce6c69b38c1c6c8b15438a30be13a79c9bfe05.