added res with tests