corner counter implemented