updates and added halt

based on stefba_b and djakku work