adapted for demo