My submission for a code academy challenge