modularized the square