pseudocode updated some, need to get into the hw to determine more pseudo code i think