make options_parse return args
add function to check option presence
revamp memory management