added ranges and removed redundancies