TRP generation script completed. Locking algorithms remain
Added comments for better readability