additions
adding missed if
reset code
more changes