Added flags to support deputy
Added busy wait code for linux