all commits in one piece. sorry. the code heavily under construction