moved all code to square tag app rule