DEBUGGING.. Unstable version. Inf loop problm