debugged and finished