Still not pretty, but it works
Prettier now