how pegasus works