WIP

	happy with this, need to review comments in trap.c first