Added isEmpty and replicate