improved brick edit mode
fixes delete scripts and bricks, refactoring