Final commit, fixed last bugs