Added cave generation, refactored painting code