code finished. DEBUGGING