functional encoding