added constructor with rank