two better implemnetation of 1003