some scale code