updated coding challenge rewrite stuff