Made pie fully work and created events structure.