Corrected target
Fixed an index check
Added option for block
Added class for block