Add isEmpty method

Need to be tested, changes made online