added nested conditions, other shit