lots of changes - still lots of errors (mainly in options handling)