Modified implementation of synch.c for cat and mouse