this code is so bad now it makes me want to vomit