modified lib/horizon