changes to ceva.c - see comments