further sudocode on how this will work