Initial design
Integrate @raimohanska's version