Added version 3, which seems to basically work. Many features to come