refactoring sign.c
first draft of the implementation section