added meansub()