Move the platform dependent code here; Temporary solution until I get time to redo...