Updated tile extraction script, still room for improvement