started adding touchFlag, made changes to square implementation