The code is a mess