code for testing and debugging added