add signal handling
declare ticks otherwise signals are never catched
add example