added module/function to partition rectangle into squares