added flags -- works except scaling