parse_factor function

Parse factors