Remove unneeded variables and fix initialization of first entity position