Done! just needs optimization