made python3 compatible and removed not necessary print statements