Almost working

There's still stuff to improve, architecture might be wrong here