Much cleaner decompiled version