add setup script and os dependent code