Final submission for coding challenge.