Implemented the is_space_free function.