changed main for more configurability