Corrected code. Added up and down functions for semaphores.

Signed-off-by: Andrew Lawson <andrewlawson@Andrews-MacBook-Air-2.local>