Loop should be fixed. Reset of arm added.