first code for analyzer: crossings and min angle, may be faulty