solution that mark wrote