added some final fixes

made the code more readable and died some issues, now thinking about
what to do next