Implement function for draw rectangle