First draft

Everything should work, still needs comments