Added optional debugging