Made encode work properly (derp)