working admissable rectangle function