MGO from scratch