add encode method...might need a different name
add note aobut name