code formatted and some minor changes

- still not working at all
- minor changes