first attempt at getting encoding working