added psuedo-ish code