Horrendous code