lots of changes, it works now