added the function isOnScreen to public interface