fix for layout
fix for correspondence tables
simple logical element drawing
changes to logic
small fixes