implimented ifFull and ifEmpty