adding a profile function

fixes #4