public void trackMouse(MouseInfo mouse){        
        double x = mouse.getX();
        double y = mouse.getY();

        float snapRealX = Math.round((x-22)/20f) * 20f + 22;
        float snapRealY = Math.round((y-25)/20f) * 20f + 25;

        int snapX = Math.round(( (float) x-22) /20f); //these are the coordinates of the grid
        int snapY = Math.round(( (float) y-25) /20f);

        if (withinField (snapRealX , snapRealY)){
            placeHolder.setLocation ( (int)snapRealX,(int)snapRealY);

            if (r == null)
            {
                r = new Range(placeHolder.getRange());
                addObject (r, Math.round (snapRealX), Math.round (snapRealY));
            }
            else 
            {
                r.setLocation (Math.round (snapRealX), Math.round (snapRealY));
            }

            if (Greenfoot.mouseClicked (null) ) {
                createTower((int)snapRealX,(int)snapRealY, snapX, snapY,Greenfoot.isKeyDown("shift")) ;

                removeObject (r);
                r = null; 
            }  
        }
    }