debugged 99%