moved parsing and analysis into separate file, revision of predicates, added new predicates,big cleanup.