adding spec and fixes for pi generator