reverted drawsquare and setlayout handling due to bugs