maybe switch this to return instead of end,