Translation from .cpp to .py complete. Need to optimize the code.
Further changes to the code. Needs to be improved for quicker results