messy spaghetti code that doesnt work