merged some code with Design.cs