Done, not very pretty but working