Kind of implemented something resembling the code, I guess