HW2 bug fixing