Now stuff works, should clean up the code and add statistics