find a way to transform square from before to after