more psuedo-coding and thoughts