almost done :)
should be reworked
it is looks like it works :)
some fixes