update

attemt to define functions needs work