Added basic railfence functionality to Encode.py