Added logical code (velocity, interaction between entities)