second example added, written in C this time