Storage locking simulation writen in pascal