modified rectangle class.