fully debugged and working