debugged first full version