added primitive ai

*fixed a bug related to updating entity positions