fixed bidirectional pig latin function