did lots of stuff but there are mistakes somewhere, need to spend some time figuring that out