tidy up some comments, add piNumber
remove unused variable