Bug fixed, improved design of Engine