Added 'getprofile' command; added some functions