added pure bash implementation
removed python impl