mostly working! some errors