debugged even more and add and functionality