implemented basic debug function and position