tested and debugged