class methods and draw rect code