removed fatal fun
added missing extern
added missing cast
removed exerns again, will need to add later