wrote some example pseudo-code