Added a function to check if slot is empty so no overwriting occurs (still needs to be worked on)