Added option check for n and s (semaphore protection)

Used Project 4 template.  Inside code is wrong.