initial work done for replacing scripts with python code