finish the code, now debugging