improved arg parsing and stuff