This is also square's code.