woking on default pattern
implemented rank()