added comments and decoupled more code
ug idk what i changed