remove test code, improved comments