better flags, fixing line parsing