written a simple entity system