Added isEmpty function