added beacon encoder sketch