edited parse method