fixed drawing problem and redesigned some drawing procedure