Semaphores

This should be about done. Lemme know what you think.