Shortened code that was too complex for now reason