snippet code for logic drawing