corrected few bugs | need better PRN