implemented most functions in cpu, ram, pager and device