Debugged part of code, long way to go.