moved some things around, used corner data to get depth and width