some changes to increase flexibility
changes to parsing and stuff