modified core logic, added update/fetchall commands/logic.