(granted, that's psuedo code, so maybe terse and errornous)