BASIC DEBUG VERSION with WRITE