We always knew the difference between cool teachers, and soft teachers. Cross a cool teacher, and he's not so cool all the sudden, lol. You have to set lines, and don't let anyone cross them. Be predictable, and consistent with punishment. That way, when they cross a line, they know it was all their fault, and you didn't spring it on them. Kids will like the security of a classroom like that.
Then again, I had a gradating class of 33 people. These methods might not work on some intercity middle schoolers, lol. They might just shank you in the teacher's lounge...