Simplified a fair bit