debugging added (not fully functional yet)