Changed code structure because it was absolute garbage. It's still absolute garbage though