Math is wrong somewhere

Trying to make Proc Building but i cant get the basics of a square. if anyone can help me where i messed up the math. that would awesome v.v