Add displacement functions, separated stubs into their own file