Renamed decode to encode

Since this is the correct name...