more debugging and adding functions