further update on the main function for love2041.cgi