Added local pygame module and fixed some bad code