[Cleaned up messy code]