Still very messy but compiles fine