If gravity got merged with the movement function liigu(), collision check and movement would be perfect.
mäller -> moller