+ added c code from the palma project