Fixed and simplified prof()