psuedo code in comments to see if approach is right