added flags to code, improved test the clarity of several tests