Dev update and new functions. Debug now in seperate file