Added spaghetti code