disgusting code this doesnt work how i want it to