fixed a bit. I need more work to make it work