this needs to be returned and used in analyze