added my version of these routines