hand function mostly finished