Add pollEvent and wait function un score.hs loops