This isn't he best code ever.