added options to subfunctions