adding debugging and completing script