initial commit, moostly working, just need to nail one bug