using det calc
Merge commit '8f1dc70e8917669de651bd20d3bc46c337f5a3a6'
using det to calculate the layout