renamed flowline -> profile, and some code clean-up.