Fix all bugs; now at a fully working version